function r = span(v, vs)
% Test whether or not vector v is in the span of a set
% of vectors.
    A = [];
    sz = size(vs); %rows - vectors
    n = vs(1);
    for i=1:n
       u = vs(i,:);
       u = u';
       A = [A u(:)];
    end
    v = v';
    v = v(:);
    if rank(A) == rank([A v])
       r = 1; %lin dep
    else
       r = 0;
    end
end
